﻿Public Class herramienta
    Private id_herramienta_ As Integer
    Private id_empresa_ As Integer
    Private nombre_ As String
    Private marca_ As String
    Private cantidad_ As Integer
    Private descripcion_ As String

    Sub New()
        id_herramienta_ = "default"
        id_empresa_ = "default"
        nombre_ = "sin nombre"
        marca_ = "sin marca"
        cantidad_ = "sin cantidad"
        descripcion_ = "sin descripcion"
    End Sub

    Property Id_empresa() As Integer
        Get
            Return id_empresa_
        End Get
        Set(ByVal value As Integer)
            If value >= 0 And value <= 20 Then
                id_empresa_ = value
            End If
        End Set
    End Property

    Property Id_herramienta() As Integer
        Get
            Return id_herramienta_
        End Get
        Set(ByVal value As Integer)
            If value >= 0 And value <= 20 Then
                id_herramienta_ = value
            End If
        End Set
    End Property

    Property Nombre() As String
        Get
            Return nombre_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                nombre_ = value
            Else
                Throw New Exception("Debe ingresar Nombre")
            End If
        End Set
    End Property

    Property Marca() As String
        Get
            Return marca_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                marca_ = value
            Else
                Throw New Exception("Debe ingresar Marca")
            End If
        End Set
    End Property

    Property Cantidad() As Integer
        Get
            Return cantidad_
        End Get
        Set(ByVal value As Integer)
            If value >= 0 And value <= 20 Then
                cantidad_ = value
            Else
                Throw New Exception("Debe ingresar Cantidad")
            End If
        End Set
    End Property

    Property Descripcion() As String
        Get
            Return descripcion_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                descripcion_ = value
            End If
        End Set
    End Property

End Class
